<template>
  <div class="rights">
    <!-- 面包屑 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>用户管理</el-breadcrumb-item>
      <el-breadcrumb-item>用户列表</el-breadcrumb-item>
    </el-breadcrumb>
    <!-- 权限列表 -->
    <el-table
    :data="rightsList"
     >
     <el-table-column
      type="index"
      >
    </el-table-column>
    <el-table-column
      label="#"
      >
    </el-table-column>
    <el-table-column
      label="权限名称"
      property="authName"
      >
    </el-table-column>
    <el-table-column
      label="路径"
      property="path"
      >
    </el-table-column>
    <el-table-column
      label="层级"
      >
      <template v-slot:default="{row}">
      <span v-if="row.level=== '0'">一级</span>
      <span v-if="row.level==='1'">二级</span>
      <span v-if="row.level==='2'">三级</span>
      </template>
    </el-table-column>
  </el-table>
  </div>
</template>

<script>
export default {
  async created () {
    const { meta, data } = await this.$axios.get(`rights/list`)
    // console.log(res)
    if (meta.status === 200) {
      this.$message.success(meta.msg)
      this.rightsList = data
    }
  },
  data () {
    return {
      rightsList: []
    }
  }
}
</script>

<style>

</style>
